package Review07;

/**
 * 获得类的class对象
 */
public class MainTest {
    public static void main(String[] args) throws ClassNotFoundException {
        //第一种
        Class cm =   MainTest.class;
        System.out.println(cm.getName());
        Class cs =  Student.class;
        System.out.println(cs.getName());
        Class ci = int.class;
        System.out.println(ci.getName());
        Class cl = long.class;
        System.out.println(cl.getName());

        //第二种class.forName();
        Class.forName("Review07.MainTest");

        //第三种
        Student student = new Student();
        Class cll = student.getClass();
    }
}
